package com.example.springmvcproject.Mapper;

import com.example.springmvcproject.Pojo.Credit;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Entity com.example.springmvcproject.Pojo.Credit
 */
public interface CreditMapper {

    void addCredit(Credit credit);


    List<Credit> selectCreditsBySelective(@Param("columnTimeName") String columnTimeName,
                                          @Param("startTime") Long startTime,
                                          @Param("endTime") Long endTime,
                                          @Param("columnSearchType") String columnSearchType,
                                          @Param("searchText") String searchText,
                                          @Param("userId") Integer userId,
                                          @Param("status") Integer status
    );

    /**
     * 根据id卡号和用户ID删除
     * @param credit
     * @return
     */
    boolean deleteCreditById(Credit credit);

    boolean updateStatusByIdAndNum(Credit credit);

    /**
     * 查询某个用户的未还款信用卡数量
     * @param userId
     * @return
     */
    Integer selectRepayCountByUserIdAndStatus(Integer userId);
}




